<?php
namespace App\Modules\Admin\Http\Controllers;

use DB;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    
    /* public function index(){
        
        return dataView(get_defined_vars());  
    }
 */
    public function index(){
        $first = DB::table('sys_menu')->get();
        $sec = DB::table('sys_menu_item')->get();
        
        $data = toArray(get_defined_vars());
        $firstArr = array_column($data['first'], 'names', 'id');
        
        foreach ($data['sec'] as $k=>$v){
            $secArr[$v['pid']][$k] = $v;
        }
        
       
        
        
        return dataView(get_defined_vars());
    }
    
    
    
    
    /* public function user(Request $request){
        $user = DB::table('sys_user')->paginate(10);
        $userArr = $user->items();
        $pages = $user->render(); 
        //var_dump($user);die;
        
        
        
        //$users = DB::table('sys_user')->where('id',1)->first();
        
        
        
        return dataView(get_defined_vars());
    }
    
    
    
    
    
    public function exam(){
        return dataView(get_defined_vars());
    } */

    
    
    

    
    public function show($id){
        //
    }

   
    public function edit($id){
        //
    }

    
    public function update(Request $request, $id){
        //
    }

    
    public function destroy($id){
        //
    }
}
